import torch

a = torch.rand(1, 1)
b = torch.rand(1, 1)

print(a, b) # ==> tensor([[0.3749]]) tensor([[0.1275]])
print(torch.dist(a, b, p=1)) # ==> a - b的绝对值 = tensor(0.2474)
print(torch.dist(a, b, p=2)) # ==> a -b的平方开根号 = tensor(0.2474)
print(torch.dist(a, b, p=3)) # ==> a - b的三次方开三次根 = tensor(0.2474)
